<template>
  <div>
    <div>
      <p>父级展示子级：{{state1.aa}}</p>
      <button @click="mainLevel">父级修改子级</button>
    </div>
    <div>
      <p>父级展示：{{state.bb}}</p>
      <button @click="childLevel">子级修改父级</button>
    </div>
  </div>
</template>

<script setup>
import { reactive, ref, toRefs } from 'vue';
import dmcfcs from './代码拆分测试'

let state = reactive({
  bb: 2,
})

let mainLevel = () => {
  state1.aa++
  childLevel()
}

const { state1, childLevel } = dmcfcs({ state, mainLevel })
console.log(state1, 11111111)
</script>
<style scoped lang ='less'>
</style>